home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d21 / except13.tec < prev    next >
Text File  |  1991-02-25  |  8KB  |  155 lines

  1. ID:13 Exception #12 and #13 and QEMM 
  2. Quarterdeck Technical Note #142
  3. by Bob Perry and Dan Sallitt
  4.  
  5. Q: What is an "Exception #12"?  What is an "Exception #13"?       
  6.                     
  7.  
  8. Q: What can be done to prevent Exception #12's and #13's?
  9.  
  10.      Exceptions are unusual or invalid conditions associated with 
  11. the execution of a particular instruction by the 80386 processor 
  12. (or higher processors).  The 80386 recognizes several different 
  13. classes of exceptions, and assigns a different vector number to 
  14. each class. The DESQview-386 memory manager, QEMM-386, has been 
  15. designed to capture these 80386 exception vectors and display 
  16. them directly to the user.
  17.  
  18.     Exception #13 is the "General Protection Fault" error.  Any 
  19. privileged instruction or any instruction that references memory 
  20. can trigger an Exception #13.  It is the most commonly 
  21. encountered 80386 fault.
  22.  
  23.     The two circumstances that can cause an Exception #13 to 
  24. occur require very different troubleshooting approaches.  In the 
  25. first case, privileged instructions, the Exception #13 could 
  26. indicate that a program has violated the protected mode of the 
  27. 80386 by executing a privileged instruction or I/O reference. 
  28. Thus, when the prompt "Terminate, Reboot or Continue?" is issued, 
  29. the "Continue" option puts the system back into real mode, and 
  30. the program should continue to execute. (After choosing the 
  31. "Continue" option, one should not necessarily assume that the 
  32. system is stable.  A reboot at the earliest convenient time is 
  33. probably wise.)
  34.  
  35.      It is the second case, instructions that reference memory, 
  36. that is far more common to DESQview 386 (and QEMM-386) users.  
  37. Here the exception may indicate that an application has a bug, or 
  38. that adverse circumstances have sent it out of control.  It has 
  39. overwritten its memory partition, and may in fact be running 
  40. wild, writing code all over the place.  This situation can occur 
  41. with some programs that were written for use on the 8088 
  42. processor and may not be usable in the 80386's virtual 8086 mode. 
  43.  
  44. A few other programs may not be compatible with QEMM-386.  In 
  45. some cases the problem occurs even without QEMM present (in which 
  46. case it manifests itself as a crash instead of an error
  47. message).  What this usually adds up to is that when "Terminate, 
  48. Reboot or Continue" is displayed, the user can usually only 
  49. "Terminate."
  50.  
  51.      On a technical level, this overwriting of the memory partition
  52. generally means that a word or a double word value of code has been
  53. written to the last byte of a segment.  The problem or "bug" in
  54. the application program or in the system shows up as an attempt
  55. to wrap the value to the next segment of memory.
  56.  
  57.      What can the user do to prevent Exception #13's?   Because a 
  58. great many problems can result in Exception #13's, it is 
  59. sometimes necessary to resort to general troubleshooting 
  60. techniques.  The DESQview 386 user should start with two simple 
  61. steps: first, run Change a Program and try to allocate more 
  62. memory to the application.  Second, the user can try to increase 
  63. the protection level of the afflicted window to 3, which will not 
  64. remove the source of the Exception #13, but may pass more 
  65. descriptive error messages through to the user.  
  66.  
  67.      When Exception #13's are obtained outside of DESQview they 
  68. are either caused by applications written for the 80386 protected 
  69. mode or they are not.  If the faulting application is written for 
  70. the protected mode of the 80386, it is likely that this program 
  71. has no VCPI (Virtual Control Program Interface) support.  Since 
  72. QEMM-386 is a protected mode program, such faulting applications 
  73. cannot be run under QEMM without VCPI.  The user has no choice 
  74. but to reboot without QEMM, and contact the developer of the 
  75. faulting application to request VCPI support.
  76.  
  77.      If the faulting application was not written for the 
  78. protected mode of the 80386, a good possibility is that the QEMM 
  79. user has installed QEMM with the RAM parameter (which is 
  80. necessary to LOADHI drivers and TSR's).  In this case the 
  81. faulting program may be running in an area of high RAM that 
  82. contains a memory conflict.  To correct this problem, the user 
  83. may opt to RAM only specific areas of memory, as described on 
  84. page 6 of the QEMM-386 manual, rather than to RAM all mappable 
  85. areas.  Of course, an area of conflict that is not RAMmed is 
  86. still an area of conflict, and may cause problems if another 
  87. application tries to map expanded memory into that region.  A 
  88. better solution to such memory conflicts might be to use the 
  89. EXCLUDE parameter (described on page 5 of the QEMM manual) on the 
  90. area in conflict.  
  91.  
  92.      When in doubt about which areas to exclude, the user may 
  93. wish to pay special attention to areas that are marked "Rammable" 
  94. on the QEMM.COM Type screen, or to High RAM areas in the F000-
  95. FFFF area.  "Rammable" areas are usually adjacent to ROM areas, 
  96. and the possiblilty exists that the ROM is slightly bigger than 
  97. QEMM could detect and is spilling over into the "Rammable" area.  
  98. High RAM areas in the F000-FFFF region are mapped over pieces of 
  99. the system ROM that either QEMM or the user have judged not to be 
  100. in use.  Obviously, this judgment should be questioned when 
  101. Exception #13 messages occur.  The F000-FFFF area should be 
  102. scrutinized especially carefully when floppy disk access 
  103. generates the exception error. 
  104.  
  105.      The QEMM.COM Accessed screen (also available as the Manifest 
  106. QEMM-386\Accessed screen) can give the user valuable hints about 
  107. what areas of memory are in use.  To use the Accessed screen, 
  108. replace the RAM parameter on the QEMM line in the CONFIG.SYS file 
  109. with the ON parameter and reboot the machine.  Any area that the 
  110. Accessed screen then shows as having been touched, but that the 
  111. Type screen shows as Mappable or Rammable, is a good candidate 
  112. for exclusion.  If the Exception #13 error only occurs with the 
  113. RAM parameter present, you can now safely perform the action that 
  114. usually generates the error, then consult the Accessed screen to 
  115. see what areas of memory have been newly touched. 
  116.  
  117.     Some pieces of hardware can come into conflict with QEMM or 
  118. DESQview and generate Exception #13 errors.  The most frequent 
  119. offenders are bus-mastering devices (hard disk controllers, 
  120. network cards, CD-ROM controllers, etc.) and autoswitching video 
  121. cards.  Bus-mastering hard disk controllers often cause Exception 
  122. #13 errors upon any use of the LOADHI programs, for instance.  
  123. For approaches to this problem, see the Quarterdeck Technical 
  124. Note titled "Bus-Mastering Devices and QEMM-386."  Not all 
  125. autoswitching video cards come into conflict with QEMM or other 
  126. pieces of software.  When a conflict occurs, however, it does not 
  127. always take the form of a video problem, and sometimes results in 
  128. the Exception #13 message.  Disabling autoswitching is the only 
  129. solution to such a problem.
  130.  
  131.     General troubleshooting methods, like temporarily removing 
  132. all TSR's, device drivers and questionable QEMM parameters, often 
  133. provide valuable information about the exception error.  It 
  134. sometimes happens that a circumstance that generates an Exception 
  135. #13 with QEMM present simply causes the machine to crash without 
  136. any message when QEMM is removed.  In such a case, QEMM is simply 
  137. the bearer of bad news.
  138.  
  139.      Exception #12 is the "Stack Segment" fault.  The stack 
  140. segment fault occurs when the processor detects certain problems 
  141. with the segment addressed by the SS segment register.  This 
  142. exception too can be the result either of a bug in a program or 
  143. of some system malfunction that eventually results in a stack 
  144. error. All of the above methods of troubleshooting Exception #13 
  145. messages should also be used when trying to track down the cause 
  146. of an Exception #12.  The one difference that should be kept in 
  147. mind is that Exception #12 messages are not generated by an 
  148. application simply going into protected mode, executing 
  149. privileged instructions, or accessing privileged registers.  
  150. Therefore you need not consider the possibility that the 
  151. application needs to incorporate VCPI support to run with QEMM.
  152.  
  153.         Copyright (C) 1991 by Quarterdeck Office Systems
  154.              * * *   E N D   O F   F I L E    * * * 
  155.